home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
Disk.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
4KB
|
149 lines
(***************************************************************************
$RCSfile: Disk.mod $
Description: Interface to disk.resource
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
<* STANDARD- *>
MODULE [2] Disk;
IMPORT e := Exec, s := Sets;
(*
** $VER: disk.h 27.11 (21.11.90)
**
** disk.h -- external declarations for the disk resource
*)
(********************************************************************
*
* Resource structures
*
********************************************************************)
TYPE
DiscResourceUnitPtr * = POINTER TO DiscResourceUnit;
DiscResourceUnit * = RECORD (e.MessageBase)
message * : e.Message;
discBlock * : e.Interrupt;
discSync * : e.Interrupt;
index * : e.Interrupt;
END; (* DiscResourceUnit *)
DiscResourcePtr * = POINTER TO DiscResource;
DiscResource * = RECORD (e.LibraryBase)
library * : e.Library;
current * : DiscResourceUnitPtr;
flags * : s.SET8;
pad * : e.UBYTE;
sysLib * : e.LibraryPtr;
ciaResource * : e.LibraryPtr;
unitID * : ARRAY 4 OF e.ULONG;
waiting * : e.List;
discBlock * : e.Interrupt;
discSync * : e.Interrupt;
index * : e.Interrupt;
currTask * : e.TaskPtr;
END; (* DiscResource *)
CONST
(* DiscResource.drFlags entries *)
alloc0 * = 0; (* unit zero is allocated *)
alloc1 * = 1; (* unit one is allocated *)
alloc2 * = 2; (* unit two is allocated *)
alloc3 * = 3; (* unit three is allocated *)
active * = 7; (* is the disc currently busy? *)
(********************************************************************
*
* Hardware Magic
*
********************************************************************)
CONST
dskDMAOff * = 4000H; (* idle command for dsklen register *)
(********************************************************************
*
* Resource specific commands
*
********************************************************************)
CONST
diskName * = "disk.resource";
(********************************************************************
*
* drive types
*
********************************************************************)
CONST
amiga * = 00000000H;
drt37422D2S * = 55555555H;
empty * = 0FFFFFFFFH;
drt150RPM * = 0AAAAAAAAH;
(**-- Resource Base variable --------------------------------------------*)
VAR
base * : DiscResourcePtr;
(**-- Resource Functions ------------------------------------------------*)
(*
** $VER: disk_protos.h 36.1 (19.2.91)
*)
PROCEDURE AllocUnit* [base,-6]
( unitNum [0] : LONGINT )
: BOOLEAN;
PROCEDURE FreeUnit* [base,-12]
( unitNum [0] : LONGINT );
PROCEDURE GetUnit* [base,-18]
( unitPointer [8] : DiscResourceUnitPtr )
: DiscResourceUnitPtr;
PROCEDURE GiveUnit* [base,-24] ();
PROCEDURE GetUnitID* [base,-30]
( unitNum [0] : LONGINT )
: LONGINT;
(* ------ new for V37 ------*)
PROCEDURE ReadUnitID* [base,-36]
( unitNum [0] : LONGINT )
: LONGINT;
BEGIN base := NIL
END Disk.